home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 July / CD 3 / redhat-6.2.iso / RedHat / instimage / usr / lib / anaconda / iw / bootdisk.py < prev    next >
Encoding:
Python Source  |  2000-03-08  |  2.2 KB  |  77 lines

  1. from iw import *
  2. from gtk import *
  3. from translate import _
  4. import iutil
  5.  
  6. class BootdiskWindow (InstallWindow):
  7.  
  8.     def __init__ (self, ics):
  9.     InstallWindow.__init__ (self, ics)
  10.  
  11.         ics.setTitle (_("Bootdisk Creation"))
  12.         ics.setPrevEnabled (0)
  13.         ics.setNextEnabled (1)
  14.         ics.readHTML ("bootdisk")
  15.         BootdiskWindow.initial = 1
  16.         self.bootdisk = None
  17.  
  18.     def getNext (self):
  19.         if iutil.getArch() == "alpha":
  20.             return None
  21.         
  22.         if not self.todo.needBootdisk():
  23.             return None
  24.         
  25.         if self.bootdisk and self.bootdisk.get_active ():
  26.             return None
  27.  
  28.         threads_leave ()
  29.         try:
  30.             self.todo.makeBootdisk ()
  31.         except RuntimeError, message:
  32.             threads_enter ()
  33.             BootdiskWindow.initial = 0
  34.             return BootdiskWindow
  35.  
  36.         threads_enter ()
  37.         return None
  38.  
  39.     def getScreen (self):
  40.         if iutil.getArch() == "alpha":
  41.             return None
  42.  
  43.         if not self.todo.bootdisk: return None
  44.  
  45.         box = GtkVBox (FALSE, 5)
  46.         im = self.ics.readPixmap ("gnome-floppy.png")
  47.         if im:
  48.             im.render ()
  49.             pix = im.make_pixmap ()
  50.             a = GtkAlignment ()
  51.             a.add (pix)
  52.             a.set (0.0, 0.0, 0.0, 0.0)
  53.             box.pack_start (a, FALSE)
  54.         
  55.         label = None
  56.         if BootdiskWindow.initial:
  57.             label = GtkLabel (_("Insert a blank floppy in the first floppy drive. "
  58.                                 "All data on this disk will be erased during creation "
  59.                                 "of the boot disk."))
  60.         else:
  61.             label = GtkLabel (_("An error occured while making the boot disk. "
  62.                                 "Please make sure that there is a formatted floppy "
  63.                                 "in the first floppy drive."))
  64.  
  65.         label.set_line_wrap (TRUE)
  66.         box.pack_start (label, FALSE)
  67.         
  68.         self.bootdisk = GtkCheckButton (_("Skip boot disk creation"))
  69.         self.bootdisk.set_active (FALSE)
  70.         box.pack_start (GtkHSeparator (), FALSE, padding=3)
  71.         box.pack_start (self.bootdisk, FALSE)
  72.  
  73.     if self.todo.fstab.rootOnLoop():
  74.         self.bootdisk.set_sensitive(FALSE)
  75.  
  76.         return box
  77.